package cn.edu.nwsuaf.examcenter.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Teacher entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "teacher", catalog = "exam")
public class Teacher implements java.io.Serializable {

	// Fields

	private String teacherNo;
	private College college;
	private String teacherName;
	private String teacherSex;
	private String teacherBirth;
	private String teacherJob;
	private String teacherPosition;
	private String teacherPhone;
	private String teacherIdcard;
	private String teacherEmail;
	private String teacherPassword;
	private Set<ExamItem> examItems = new HashSet<ExamItem>(0);
	private Set<CourceEmployee> courceEmployees = new HashSet<CourceEmployee>(0);
	private Set<ExamPaperInfo> examPaperInfos = new HashSet<ExamPaperInfo>(0);

	// Constructors

	/** default constructor */
	public Teacher() {
	}

	/** minimal constructor */
	public Teacher(String teacherNo, College college, String teacherName,
			String teacherSex, String teacherBirth, String teacherJob,
			String teacherPosition, String teacherPhone, String teacherIdcard,
			String teacherEmail, String teacherPassword) {
		this.teacherNo = teacherNo;
		this.college = college;
		this.teacherName = teacherName;
		this.teacherSex = teacherSex;
		this.teacherBirth = teacherBirth;
		this.teacherJob = teacherJob;
		this.teacherPosition = teacherPosition;
		this.teacherPhone = teacherPhone;
		this.teacherIdcard = teacherIdcard;
		this.teacherEmail = teacherEmail;
		this.teacherPassword = teacherPassword;
	}

	/** full constructor */
	public Teacher(String teacherNo, College college, String teacherName,
			String teacherSex, String teacherBirth, String teacherJob,
			String teacherPosition, String teacherPhone, String teacherIdcard,
			String teacherEmail, String teacherPassword,
			Set<ExamItem> examItems, Set<CourceEmployee> courceEmployees,
			Set<ExamPaperInfo> examPaperInfos) {
		this.teacherNo = teacherNo;
		this.college = college;
		this.teacherName = teacherName;
		this.teacherSex = teacherSex;
		this.teacherBirth = teacherBirth;
		this.teacherJob = teacherJob;
		this.teacherPosition = teacherPosition;
		this.teacherPhone = teacherPhone;
		this.teacherIdcard = teacherIdcard;
		this.teacherEmail = teacherEmail;
		this.teacherPassword = teacherPassword;
		this.examItems = examItems;
		this.courceEmployees = courceEmployees;
		this.examPaperInfos = examPaperInfos;
	}

	// Property accessors
	@Id
	@Column(name = "teacher_no", unique = true, nullable = false, length = 50)
	public String getTeacherNo() {
		return this.teacherNo;
	}

	public void setTeacherNo(String teacherNo) {
		this.teacherNo = teacherNo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "college_no", nullable = false)
	public College getCollege() {
		return this.college;
	}

	public void setCollege(College college) {
		this.college = college;
	}

	@Column(name = "teacher_name", nullable = false, length = 50)
	public String getTeacherName() {
		return this.teacherName;
	}

	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}

	@Column(name = "teacher_sex", nullable = false, length = 5)
	public String getTeacherSex() {
		return this.teacherSex;
	}

	public void setTeacherSex(String teacherSex) {
		this.teacherSex = teacherSex;
	}

	@Column(name = "teacher_birth", nullable = false, length = 50)
	public String getTeacherBirth() {
		return this.teacherBirth;
	}

	public void setTeacherBirth(String teacherBirth) {
		this.teacherBirth = teacherBirth;
	}

	@Column(name = "teacher_job", nullable = false, length = 5)
	public String getTeacherJob() {
		return this.teacherJob;
	}

	public void setTeacherJob(String teacherJob) {
		this.teacherJob = teacherJob;
	}

	@Column(name = "teacher_position", nullable = false, length = 5)
	public String getTeacherPosition() {
		return this.teacherPosition;
	}

	public void setTeacherPosition(String teacherPosition) {
		this.teacherPosition = teacherPosition;
	}

	@Column(name = "teacher_phone", nullable = false, length = 13)
	public String getTeacherPhone() {
		return this.teacherPhone;
	}

	public void setTeacherPhone(String teacherPhone) {
		this.teacherPhone = teacherPhone;
	}

	@Column(name = "teacher_idcard", nullable = false, length = 18)
	public String getTeacherIdcard() {
		return this.teacherIdcard;
	}

	public void setTeacherIdcard(String teacherIdcard) {
		this.teacherIdcard = teacherIdcard;
	}

	@Column(name = "teacher_email", nullable = false, length = 50)
	public String getTeacherEmail() {
		return this.teacherEmail;
	}

	public void setTeacherEmail(String teacherEmail) {
		this.teacherEmail = teacherEmail;
	}

	@Column(name = "teacher_password", nullable = false, length = 50)
	public String getTeacherPassword() {
		return this.teacherPassword;
	}

	public void setTeacherPassword(String teacherPassword) {
		this.teacherPassword = teacherPassword;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<ExamItem> getExamItems() {
		return this.examItems;
	}

	public void setExamItems(Set<ExamItem> examItems) {
		this.examItems = examItems;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<CourceEmployee> getCourceEmployees() {
		return this.courceEmployees;
	}

	public void setCourceEmployees(Set<CourceEmployee> courceEmployees) {
		this.courceEmployees = courceEmployees;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<ExamPaperInfo> getExamPaperInfos() {
		return this.examPaperInfos;
	}

	public void setExamPaperInfos(Set<ExamPaperInfo> examPaperInfos) {
		this.examPaperInfos = examPaperInfos;
	}

}